package com.liuweiheng.cloud.timer;

import org.quartz.*;

import java.time.LocalDateTime;
import java.util.UUID;

public class HelloJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        JobDataMap jobDataMap1 = jobExecutionContext.getTrigger().getJobDataMap();
        Object tv1 = jobDataMap1.get("t1");
        Object tv2 = jobDataMap1.get("t2");

        JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap();
        Object jv1 = jobDataMap.get("j1");
        Object jv2 = jobDataMap.get("j2");

        Object sv = null;
        try {
            sv = jobExecutionContext.getScheduler().getContext().get("skey");
        } catch (SchedulerException e) {
            e.printStackTrace();
        }
        System.out.println(tv1+":"+tv2);
        System.out.println(jv1+":"+jv2);
        System.out.println(sv);
        System.out.println("hello:"+ LocalDateTime.now());
    }
}
